﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace WCFService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IService1
    {

        [OperationContract]
        string GetData(int value);

        [OperationContract]
        CompositeType GetDataUsingDataContract(CompositeType composite);
        
        // TODO: Add your service operations here
        [OperationContract]
        bool insert_KH_NGHIEP_VU(string ma_nv, string ten_nv, DateTime ngay_bd);
        [OperationContract]
        bool edit_KH_NGHIEP_VU(Int64 id_nv, string ma_nv, string ten_nv, DateTime ngay_bd);
        [OperationContract]
        List<KH_NGHIEP_VU> get_all_KH_NGHIEP_VU();
        [OperationContract]
        List<KH_NGHIEP_VU> search_kh_nghiep_vu(string key);
        [OperationContract]
        bool del_KH_NGHIEP_VU(Int64 id_nv);

    }


    // Use a data contract as illustrated in the sample below to add composite types to service operations.
    [DataContract]
    public class CompositeType
    {
        bool boolValue = true;
        string stringValue = "Hello ";

        [DataMember]
        public bool BoolValue
        {
            get { return boolValue; }
            set { boolValue = value; }
        }

        [DataMember]
        public string StringValue
        {
            get { return stringValue; }
            set { stringValue = value; }
        }
    }
    [DataContract]
    public class KH_NGHIEP_VU
    {
        long id = 0;
        string ten_nv = "";
        string ma_nv = "";
        DateTime ngay_bd = DateTime.Now;
        [DataMember]
        public long Id
        {
            get { return id; }
            set { id = value; }
        }
        [DataMember]
        public string Ten_nv
        {
            get { return ten_nv; }
            set { ten_nv = value; }
        }
        [DataMember]
        public string Ma_nv
        {
            get { return ma_nv; }
            set { ma_nv = value; }
        }
        [DataMember]
        public DateTime Ngay_bd
        {
            get { return ngay_bd; }
            set { ngay_bd = value; }
        }
    }
}
